package ie.dkit.java3Demulation.objects3d;

import java.util.ArrayList;
import java.util.Collection;

import ie.dkit.java3Demulation.drawer.Circle3DDrawable;
import ie.dkit.java3Demulation.transforming.Transformable;

public class Circle3D implements Transformable, Circle3DDrawable {

	private String m_Name;

	// The Center Point of the Circle
	private Point3D m_CenterPoint;

	// The Radius of the Point
	private double m_Radius;

	// The Facing Point. With this you can calculate the eclipse
	private Point3D m_FacingPoint;

	// The Point for the Transormation
	private Point3D m_RotationPoint;

	public Circle3D() {
		m_CenterPoint = new Point3D();
		m_CenterPoint.setName("Center Point");
		m_FacingPoint = new Point3D(0, 0, 10);
		m_FacingPoint.setName("Facing Point");
		m_Name = "Circle3D";
		m_Radius = 100;
	}

	/**
	 * Create a new Circle3D
	 * 
	 * @param centerPoint
	 * @param radius
	 * @param facingPoint
	 */
	public Circle3D(Point3D centerPoint, double radius, Point3D facingPoint) {
		super();
		m_CenterPoint = centerPoint;
		m_Radius = radius;
		m_FacingPoint = facingPoint;
	}

	public Point3D getM_CenterPoint() {
		return m_CenterPoint;
	}

	public void setM_CenterPoint(Point3D centerPoint) {
		m_CenterPoint = centerPoint;
	}

	public Point3D getM_FacingPoint() {
		return m_FacingPoint;
	}

	public void setM_FacingPoint(Point3D facingPoint) {
		m_FacingPoint = facingPoint;
	}

	public double getM_Radius() {
		return m_Radius;
	}

	public void setM_Radius(double radius) {
		m_Radius = radius;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#getName()
	 */
	public String getName() {
		return m_Name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.objects.GraphicsObject#setName(java.lang.String)
	 */
	public void setName(String name) {
		m_Name = name;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.transforming.Transformable#getPoints()
	 */
	public Collection<Point3D> getPoints() {
		Collection<Point3D> returnValue = new ArrayList<Point3D>();
		returnValue.add(m_CenterPoint);
		returnValue.add(m_FacingPoint);
		return returnValue;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.transforming.Transformable#getRotationPoint()
	 */
	public Point3D getRotationPoint() {
		return m_RotationPoint;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see ie.dkit.java3Demulation.transforming.Transformable#setRotationPoint(ie.dkit.java3Demulation.objects3d.Point3D)
	 */
	public void setRotationPoint(Point3D point3D) {
		m_RotationPoint = point3D;
	}

	public Collection<Circle3D> getCircle3Ds() {
		Collection<Circle3D> returnValue = new ArrayList<Circle3D>();
		returnValue.add(this);
		return returnValue;
	}

}
